package com.hd.trans.homefun;

import android.app.Activity;
import android.content.Context;
import android.os.Parcel;
import android.os.Parcelable;

import androidx.core.app.ActivityOptionsCompat;

public interface HomeFun {
    void clickType(Context context, HomeFun.FunType funType);
    void funType(Context context, HomeFun.FunType funType);
    boolean isVip();
    void startActivity(Activity content, ActivityOptionsCompat compat, HomeFun.FunType funType);

    enum FunType implements Parcelable {
        fun_my_home_create,//MyHomeActivity onCreate
        fun_my_home_resume,//MyHomeActivity onResume
        fun_my_home_pause,//MyHomeActivity onPause
        fun_my_home_destroy,//MyHomeActivity onDestroy
        fun_my_home_stop,//MyHomeActivity onStop
        fun_my_home_back_pressed,//MyHomeActivity onBackPressed
        fun_pzfy,     //拍照翻译
        fun_yyfy,     //语音翻译
        fun_tscy,     //同声传译
        fun_gdgn,     //更多功能
        fun_wode,     //我的
        click_vip,    //vip
        click_yhq,    //优惠券
        click_files,  //文档列表
        click_banner, //banner
        click_return_favorites;//返回收藏夹
        public static final Creator<FunType> CREATOR = new Creator<HomeFun.FunType>() {
            @Override
            public HomeFun.FunType createFromParcel(Parcel in) {
                return HomeFun.FunType.values()[in.readInt()];
            }

            @Override
            public HomeFun.FunType[] newArray(int size) {
                return new HomeFun.FunType[size];
            }
        };

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeInt(ordinal());
        }
    }
}
